﻿<catel:DataWindow x:Class="Catel.Articles._03___MVVM.Examples.UserControlWithParameter.CompaniesWindow"
                  xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                  xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                  xmlns:UserControlWithParameter="clr-namespace:Catel.Articles._03___MVVM.Examples.UserControlWithParameter"
                  xmlns:catel="http://catel.codeplex.com"
                  x:TypeArguments="UserControlWithParameter:CompaniesViewModel"
                  MinWidth="500" MaxWidth="500" MinHeight="400" MaxHeight="400">
    
    <!-- Resources -->
    
    <!-- Content -->
    <Grid>
        <!-- Column definitions -->
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="200" />
            <ColumnDefinition Width="*" />
        </Grid.ColumnDefinitions>
        
        <!-- Items control of companies -->
        <ListBox Grid.Column="0" ItemsSource="{Binding CompanyCollection}" SelectedItem="{Binding SelectedCompany}">
            <ListBox.ItemTemplate>
                <DataTemplate>
                    <StackPanel>
                        <Label Content="{Binding Name}" />
                        <Label Content="{Binding CEO.FullName}" />
                    </StackPanel>
                </DataTemplate>
            </ListBox.ItemTemplate>
        </ListBox>
        
        <!-- Company details -->
        <UserControlWithParameter:Company Grid.Column="1" DataContext="{Binding SelectedCompany}" />
    </Grid>
</catel:DataWindow>
